<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>

</head>
<body>
	<input type="button" id="btn" value="请求">


	<script type="text/javascript">
		window.onload=function(){
			var obtn=document.getElementById('btn');
			obtn.onclick=function(){	
				/*let xhr=new XMLHttpRequest();
				
				xhr.open('get','a.txt',true);
				xhr.send();
				
				xhr.onreadystatechange=function(){
					if(xhr.readyState==4){
						if(xhr.status>200&&xhr.status<300||xhr.status==304){
							alert(xhr.responseText);
						}
					}
				}*/
			//1,创建子进程；	
			let w=new Worker('webWorkerAJ.js');
			// alert(w)
			//2,传数据，抱在json里
			// w.postMessage({n1,n2});
			//6,接受子进程传回的数据
			// w.onmessage=function(ev){
				// alert(ev.data);
			// }
		}
	}
</script>
</body>
</html>